package com.asha.md360player4android.vr.display;


import com.asha.vrlib.MDVRLibrary;
import com.asha.vrlib.strategy.display.AbsDisplayStrategy;
import com.asha.vrlib.strategy.display.DisplayModeManager;
import com.asha.vrlib.strategy.display.IFYDisplayFactory;

/**
 * Created by android on 5/25/17.
 */

public class CustomDisplayFactory implements IFYDisplayFactory {

    public static final int CUSTOM_DISPLAY_MODE_NORMAL = MDVRLibrary.DISPLAY_MODE_NORMAL + 101;
    public static final int CUSTOM_DISPLAY_MODE_BLOCK_SINGLE = MDVRLibrary.DISPLAY_MODE_NORMAL + 102;
    public static final int CUSTOM_DISPLAY_MODE_BLOCK_SINGLE_2 = MDVRLibrary.DISPLAY_MODE_NORMAL + 103;
    public static final int CUSTOM_DISPLAY_MODE_BLOCK_TOP_BOTTOM = MDVRLibrary.DISPLAY_MODE_NORMAL + 104;
    public static final int CUSTOM_DISPLAY_MODE_BLOCK_FOUR_RECT = MDVRLibrary.DISPLAY_MODE_NORMAL + 105;
    public static final int CUSTOM_DISPLAY_MODE_FISH_EYE = MDVRLibrary.DISPLAY_MODE_NORMAL + 106;
    public static final int CUSTOM_DISPLAY_MODE_CALIBRATE = MDVRLibrary.DISPLAY_MODE_NORMAL + 107;

    @Override
    public AbsDisplayStrategy createStrategy(int mode, DisplayModeManager.Params params) {
        switch (mode) {
            case CUSTOM_DISPLAY_MODE_NORMAL:
                return new NormalStrategy(params);
            case CUSTOM_DISPLAY_MODE_BLOCK_SINGLE:
                return new SingleStrategy(params);
            case CUSTOM_DISPLAY_MODE_BLOCK_SINGLE_2:
                return new SingleStrategy2(params);
            case CUSTOM_DISPLAY_MODE_BLOCK_TOP_BOTTOM:
                return new TopBottomBlockStrategy(params);
            case CUSTOM_DISPLAY_MODE_BLOCK_FOUR_RECT:
                return new FourBlockStrategy(params);
            case CUSTOM_DISPLAY_MODE_FISH_EYE:
                return new FishEyeStrategy(params);
            case CUSTOM_DISPLAY_MODE_CALIBRATE:
                return new CalibrateStrategy(params);
        }
        return null;
    }
}
